var base64 = new Base64();
var vm = new Vue({
    el: '#app',
    data () {
      return{
        list: [],
        orderStatus: {
            PENDING: 0,
            CHECK_PENDING: 1,
            UNACCEPTED: 2,
            ACCEPTED: 3,
            TRADE_SUCCESS: 4,
            TRADE_CLOSE: 5,
            WAIT_FOR_SERVICE: 6
        }
      }
    },
    methods: {
        init: function() {
          params=new Object();
          params.technician = api.getGlobalData({
              key: 'technicianid'
          });
          //params.technician ='1039431554591379457';
          params.status = this.orderStatus.TRADE_SUCCESS;
          params.asc = true; // false:未接的单放在最前面    true：已处理过的单子放在最前面
          params.type = 'noPhoto';
          vm.findOrderNophoto(params, function(ret, err) {
              // console.log('ret' + JSON.stringify(ret));
              vm.list = ret;
              // console.log('technicianid:'+params.technician);
              // console.log('vm.listlength:'+vm.list.length);
              // console.log('nophotolist:'+JSON.stringify(ret));
            //  openWin('supplementphoto');
            //  console.log('list:'+JSON.stringify(vm.list[0])); // vm.list[0]
          });
        },
        openBeforephoto: function(order) {
          api.setGlobalData({
              key: 'curOrder',
              value: order
          });
          $api.openWin('beforephoto')
        },
        findOrderNophoto: function(params,callback) {

            $api.ajax(function(ret, err) {
              //  console.log('ret' + JSON.stringify(ret));
                console.log('err' + JSON.stringify(err));
                if (ret) {
                    this.list = ret;
                    callback(ret, err);
                }
            }, 'order/findOrderList', 'post', params);
        }
    }
});
